package com.pktechan.manage.service.impl;


import com.pktechan.manage.base.BaseMapper;
import com.pktechan.manage.base.BaseServiceImpl;
import com.pktechan.manage.dao.SysOperateMapper;
import com.pktechan.manage.entity.SysOperate;
import com.pktechan.manage.service.SysOperateService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <br>
 * <b>功能：</b>SysOperateService<br>
 * <b>作者：</b>Wang Jiahao<br>
 * <b>日期：</b> Mar 23, 2016 <br>
 * <b>版权所有：<b>版权所有(C) 2016，高晟财富<br>
 */
@Service("sysOperateService")
public class SysOperateServiceImpl extends BaseServiceImpl<SysOperate> implements SysOperateService {
	private static final Logger LOGGER = LoggerFactory.getLogger(SysOperateServiceImpl.class);

	@Autowired
	private SysOperateMapper sysOperateMapper;

	/**
	 * 查询角色相应权限
	 * TA清算
	 * @param userId
	 *            指定的角色Id
	 */
	public List<SysOperate> queryOperateList(Integer userId) {
		LOGGER.debug("根据角色编号查询对应的权限列表");
		List<SysOperate> operates = sysOperateMapper.queryOperateList(userId);
		return operates;
	}

	/**
	 * 查询全部权限
	 *
	 * @return
	 */
	public List<SysOperate> queryAllOperateList() {
		LOGGER.debug("查询全部权限");
		List<SysOperate> operates = sysOperateMapper.queryAllOperateList();
		return operates;
	}

	/**
	 * 由业务类实现
	 *
	 * @return
	 */
	@Override
	public BaseMapper<SysOperate> getBaseMapper() {
		return sysOperateMapper;
	}
}